<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">

<body data-type="index">
    <div class="am-g tpl-g">
        <!-- 头部 -->
        <jsp:include page="common/header.jsp"></jsp:include>
        <!-- 风格切换 -->

        <!-- 侧边导航栏 -->
        <jsp:include page="common/memu.jsp"></jsp:include>


        <!-- 内容区域 -->
        <div class="tpl-content-wrapper">

            <div class="row-content am-cf">
                <div class="row  am-cf">
                    
                    <div class="row">

                    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
                        <div class="widget am-cf">
                            <div class="widget-head am-cf">
                                <div class="widget-title am-fl">银行卡开户</div>
                                <div class="widget-function am-fr">
                                    <a href="javascript:;" class="am-icon-cog"></a>
                                </div>
                            </div>
                            <div class="widget-body am-fr">

                                <form class="am-form tpl-form-line-form">
                                    <div class="am-form-group">
                                        <label for="password" class="am-u-sm-3 am-form-label">密码 <span class="tpl-form-line-small-title"></span></label>
                                        <div class="am-u-sm-9">
                                            <input type="password" class="tpl-form-input" id="password" placeholder="请输入4位银行卡密码">
                                            <small></small>
                                        </div>
                                    </div>

                                    <div class="am-form-group">
                                        <label for="confirmPwd" class="am-u-sm-3 am-form-label">确认密码 <span class="tpl-form-line-small-title"></span></label>
                                        <div class="am-u-sm-9">
                                            <input type="password" class="tpl-form-input" id="confirmPwd" placeholder="请输入4位银行卡密码">
                                            <small></small>
                                        </div>
                                    </div>

                                    

                                    <div class="am-form-group">
                                        <div class="am-u-sm-9 am-u-sm-push-3">
                                            <button onclick="openaccount();" type="button" class="am-btn am-btn-primary tpl-btn-bg-color-success ">开户</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>

                </div>

                </div>

            </div>
        </div>
    </div>
    </div>
    <script src="assets/js/amazeui.min.js"></script>
    <script src="assets/js/amazeui.datatables.min.js"></script>
    <script src="assets/js/dataTables.responsive.min.js"></script>
    <script src="assets/js/app.js"></script>

    <script>
        function openaccount() {
            var dog = {
                age : '888',
                price : 999
            };
            dog.name = 'wc007';

            var password = $('#password').val();
            var confirmPwd = $('#confirmPwd').val();
            $.get("/card", {
                action : 'openaccount',
                password : password,
                confirmPassword : confirmPwd
            }, function (xx) {
                if (xx.code != 1000) {
                    alert(xx.message);
                    return;
                }

                alert('恭喜你，开户成功啦！');
                //开户成功，页面跳转到首页
                window.location.href = '/toPage?pageName=index';
            });
        }

        $('#openaccountA').addClass("active")
    </script>

</body>

</html>